<?php

    class seo_model extends CI_Model {

        var $table = "seo";

        function find_by_id($post_ID) {

            $q = "SELECT * FROM seo WHERE posts_ID = $post_ID";
            $res = $this->db->query($q)->row_array();

            return $res;
        }

        function insert($data) {
            $this->db->insert($this->table, $data);
            return $this->db->insert_id();
        }

        function update($id, $data) {
            $this->db->where('ID', $id);
            $this->db->update($this->table, $data);
        }

    }

?>
